﻿@model IEnumerable<TCM.Course>

@{
    ViewBag.Title = "Index";
}

<link href="~/Content/DataTableNet/jquery.dataTables.css" rel="stylesheet" />
<div class="IndexBack">
    @Html.ActionLink(" ", "../")
</div>

<div class="toolbar">
    @Html.ActionLink("Create New", "Create")
</div>

<table class="grdTable" style="width: 100%;" cellspacing="0">
    <thead>
        <tr >
            <th>
                @Html.DisplayNameFor(model => model.Name)
            </th>

            <th>
                @Html.DisplayNameFor(model => model.CourseCode)
            </th>

            <th>
                Instructor
            </th>

            <th>
                @Html.DisplayNameFor(model => model.Capacity)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.StartDate)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.EndDate)
            </th>
            <th>...</th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
        {
            <tr>

                <td>
                    @Html.DisplayFor(modelItem => item.Name)
                </td>

                <td>
                    @Html.DisplayFor(modelItem => item.CourseCode)
                </td>

                <td>
                    @Html.DisplayFor(modelItem => item.Instructor.Name)
                </td>

                <td>
                    @Html.DisplayFor(modelItem => item.Capacity)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.ExFromDate)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.ExToDate)
                </td>

                <td>
                    @Html.ActionLink("Edit", "Edit", new { id = item.CourseID }) |
           
                    @Html.ActionLink("Delete", "Delete", new { id = item.CourseID })
                </td>
            </tr>
        }
    </tbody>

</table>
